# coding:utf-8
# Project:pyinterface
# author:wj
# time:2022/12/30 17:52
# Email:1305137785@qq.com

from faker import Faker
class Handle_Faker:
    def __init__(self):
        self.fac = Faker(locale="zh_CN")
    # 生成姓名
    def get_name(self):
        name = self.fac.name()
        print("姓名是{}".format(name))
        return name
    # 生成id
    def get_id(self):
        id=self.fac.credit_card_security_code()
        print(f'id是{id}')
        return id
#    生成银行卡号
    def get_bank_number(self):
        bank_number = self.fac.credit_card_number()
        print('银行卡号{}'.format(bank_number))
        return bank_number
    # 生成邮箱
    def get_account_email(self):
        email = self.fac.email()
        return email
#    生成手机号码
    def get_phone_number(self):
        phone= self.fac.phone_number()
        return phone
#     获取企业名称
    def get_company_name(self):
        company_name = self.fac.company()
        print('公司名称{}'.format(company_name))
        return company_name
# 生成指定长度的随机数
    def get_random_number(self):
       random_number = self.fac.random_number(digits=5)
       print(random_number)
       return random_number
# 生成随机的位数小数
    def get_random_falot(self):
        random_float = self.fac.pyfloat(left_digits=1,right_digits=2,positive=True)
        print(random_float)
        return random_float



if __name__ == '__main__':
    handle_fasker=Handle_Faker()
    handle_fasker.get_account_email()
    handle_fasker.get_random_number()
    handle_fasker.get_random_falot()